﻿<%--<!DOCTYPE html>--%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="bootstrap2.3.2/css/bootstrap.min.css" rel="stylesheet" />
    <title></title>
    <link href="styles/Common.css" rel="stylesheet" />
    <link href="styles/Index.css" rel="stylesheet" />
	<link href="styles/Index2.css" rel="stylesheet" />
</head>
<body>
    <div class="header">

        <img class="logo" src="images/logo.png" />
        <label class="logo-title">通用后台模板</label>
        <ul class="inline">
            <li>
                <img src="images/32/client.png" />&nbsp;&nbsp;欢迎您,${user.uAccount}
            </li>
            <li class="dropdown">
                <a class="dropdown-toggle mymsg" data-toggle="dropdown" href="#"><img src="images/32/166.png" />&nbsp;&nbsp;修改个人信息<b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="password.jsp">修改密码</a></li>
                </ul>

            </li>
            <li>
                <img src="images/32/200.png" />&nbsp;&nbsp;<a class="loginout" href="login.jsp">退出</a>
            </li>

        </ul>


    </div>


    <div class="nav">

        <ul class="breadcrumb">
            <li>
                <img src="images/32/5025_networking.png" />
            </li>
            <li><a href="index.jsp">首页</a> <span class="divider">>></span></li>
            <li class="active">修改密码</li>
        </ul>
    </div>



    <div class="container-fluid content">
        <div class="row-fluid">
            <div class="span2 content-left">
                <div class="accordion">
                    <div class="accordion-group">
                        <div class="accordion-heading">
                            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                                <img class="left-icon" src="images/32/5026_settings.png" /><span class="left-title">系统设置</span>
                            </a>
                        </div>
                        <div id="collapseOne" class="accordion-body collapse in">
                            <div class="accordion-inner">
                                 <a href="list.jsp"> <img class="left-icon-child" src="images/32/4962_sitemap.png" /><span class="left-body"> 药品管理</span></a>
                            </div>
                            
                            <div class="accordion-inner">
                              <a href="password.jsp">  <img class="left-icon-child" src="images/32/4992_user.png" /><span class="left-body"> 修改密码</span></a>

                            </div>
                            <div class="accordion-inner">
                              <a href="login.jsp">  <img class="left-icon-child" src="images/32/4958_login.png" /><span class="left-body"> 退出登陆</span></a>

                            </div>
                        </div>
                    </div>
                </div>

            </div>

            <div class="span10 content-right">
               <div class="container-fluid">
        <div class="row" style="padding-top:20px">
            

                        <div class="control-group">
                            <label class="control-label" for="oldPwd">原始密码</label>
                            <div class="controls">
                                <input type="password" onchange="checkoldpwd()" id="oldPwd" placeholder="原始密码"><span id="sp"></span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="newPassword">新密码</label>
                            <div class="controls">
                                <input type="password" id="newPassword" placeholder="新密码">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="repassword">确认密码</label>
                            <div class="controls">
                                <input type="password" id="repassword" placeholder="确认密码">
                                <span id="info2"></span>
                            </div>
                        </div>
                        
						 <div class="control-group">
						   <div class="controls">
						    <button type="submit" id="tj" class="btn btn-success">提交</button>

						   </div>
						 </div>

           
        </div>
    </div>
            </div>
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="foot"></div>
    <script src="scripts/jquery-1.9.1.min.js"></script>
    <script src="bootstrap2.3.2/js/bootstrap.min.js"></script>
    <script src="scripts/Index.js"></script>
	<div style="text-align:center;">
<p>来源:<a href="http://www.mycodes.net/" target="_blank">源码之家</a></p>
</div>
<script type="text/javascript">
    $("#tj").click(function () {
        $.ajax({
            type: "post",
            url:"user?method=update",
            data:"newPassword="+$("#newPassword").val(),
            success:function (result) {
                if(result>0){
                    alert("修改成功请重新登录");
                    location.href="login.jsp";
                }else{
                    alert("修改失败");
                    console.log(result);
                }
            }


        })


    })
    $("#repassword").change(function () {
        if($("#newPassword").val()==$("#repassword").val()){
            $("#info2").text("对").css("color","green");
            $("#tj").removeAttr("disabled");
        }else{
            $("#info2").text("错").css("color","red");
            $("#tj").attr("disabled",true);
        }
    })

    function checkoldpwd() {
        $.ajax({
            type:"post",
            url:"user?method=checkPwd",
            data:"oldPwd="+$("#oldPwd").val(),
            success:function (result) {
                if(result==1){
                    $("#sp").text("√");
                    $("#tj").prop("disabled","");
                }else{
                    $("#sp").text("×");
                    $("#tj").prop("disabled","disabled");

                }
            }

        })

    }



</script>

</body>
</html>
